const state = {
  // 交易申请
  // 客户信息
  cust_type: '', // 客户类型
  // 个人客户
  personal: {},
  province_city_area: [
    {
      value: '01',
      label: '江苏省',
      children: [
        {
          value: '01',
          label: '南京市',
          children: [
            {
              value: '01',
              label: '鼓楼区'
            },
            {
              value: '02',
              label: '秦淮区'
            },
            {
              value: '03',
              label: '建邺区'
            }
          ]
        }
      ]
    }
  ],
  // 企业客户
  company: {},
  cust_info_apply: false, // 是否已提交用户信息
  // 设备信息
  assets_info: {},
  // 报价方案
  scheme_info: {},
  // 担保信息
  guarantee_info: {},
  // 附件信息
  attachment_info: {}
}
const getters = {
  getFlag: state => state.cust_info_apply
}
const mutations = {
  UPDAE_CUST_TYPE (state, type) {
    state.cust_type = type
  },
  UPDATE_PERSONAL (state, personal) {
    state.personal = personal
  },
  UPDATE_CUST_INFO_APPLY (state, flag) {
    state.cust_info_apply = flag
  }
}

const actions = {
  updateCustType: ({ commit }, type) => {
    commit('UPDAE_CUST_TYPE', type)
  },
  updatePersonal: ({ commit }, personal) => {
    commit('UPDATE_PERSONAL', personal)
  },
  updateCustInfoApply: ({ commit }, flag) => {
    commit('UPDATE_CUST_INFO_APPLY', flag)
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
